<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ page import="javax.sql.*, model.*"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html:html>
<HEAD>
<TITLE>Reviewer Home!</TITLE>
</HEAD>
<BODY>
	<html:errors />
	
	Reviewer Home: <a href="../invalidate.jsp" style="float: right;">logout</a><hr style="text-decoration:bold;" /> <br /> <hr />
		<table>
			<tr>
				<th>Applicant Name</th>
				<th>Grade</th>
				<th>Comments about Applicant</th>
				<th>Action</th>
			</tr>
			<%
				RowSet applicationsByReviewer = (RowSet) session.getAttribute("applicationsByReviewer");
				int applicantId = 0;
				Applicant applicant; 
				while (applicationsByReviewer.next()) {
					
				applicantId = applicationsByReviewer.getInt("id");
				applicant = Database.getApplicantById(applicantId);
			%>
				<tr>
				<html:form action="/reviewerChoice" focus="street">
					<td style="width: 200px; text-align: center;"> 
						<html:link href="/StrutsCSE135/pages/reviewer/applicationReview.jsp">
							<html:param name="user" value="<%= Integer.toString(applicantId) %>" />
							<%= applicant.getName() %>
						</html:link>
					</td>
					<td style="width: 200px; text-align: center;"> <html:select property="gradeSelect">
							<html:option value="1"> 1 </html:option>
							<html:option value="2"> 2 </html:option>
							<html:option value="3"> 3 </html:option>
							<html:option value="4"> 4 </html:option>
						 </html:select>
					</td>
					<td> <html:text property="gradeComments" style="width: 500px; margin-left: 30px;" /></td>
					<td> <html:submit value="Submit Grade" /> </td>
					</html:form>
				</tr>
			<% } %>
		</table>
</body>
</html:html>